package dk.itu.KrakMap;

import graphlib.Node;
import org.omg.PortableInterceptor.SYSTEM_EXCEPTION;

/**
 * A graph node, created from a NodeData object.
 * Note that KDV_ID is used as a global id number, while
 * KDV# is assumed to be continuous in the loaded file.
 */
public class KrakNode extends Node {
  private MapPoint mapPoint;
  //private double X; // Geographic X, meter East in UTM zone 32
  //private double Y; // Geographic Y, meter North of Equator

  /**
   * @return The geographic X coordinate, meter East in UTM zone 32
   */
  public double getX(){
     return mapPoint.getX();
  }
	
  /**
   * @return The geographic Y coordinate, meter North of Equator 
   */
  public double getY(){
     return mapPoint.getY();
  }

  /**
   * @return A MapPoint representing the KrakNode
   */
  public MapPoint getMapPoint(){
    return new MapPoint(getX(),getY());
  }

  /**
   * Constructor of KrakNode.
   * @param data Nodedata in the format: "ARC, KDV, KDV_ID, X_COORD, Y_COORD"
   */
  public KrakNode(NodeData data){
    super(data.KDV);
    mapPoint = new MapPoint(data.X_COORD,data.Y_COORD);
  }

    @Override
    public String toString()
    {
        return "KrakNode at ("+mapPoint.getX()+";"+mapPoint.getY()+")";
    }
}
